//Copyright (c) Microsoft Corporation.  All rights reserved.

using System;
using System.Collections.Generic;
using System.Text;
using Eas.WebCrawler.Interfaces;

namespace Eas.WebCrawler.Test.Model {
    internal class BaseSettings : Eas.WebCrawler.Interfaces.WebCrawlerSettings {

        public BaseSettings() { }
        public BaseSettings(Eas.WebCrawler.Interfaces.WebCrawlerSettings other) {
            RequestPriorityComparer = other.RequestPriorityComparer;
            LinkExtractor = other.LinkExtractor;
            WorkerCount = other.WorkerCount;
            StartingUris = other.StartingUris;
            Selector = other.Selector;
            StorageFactory = other.StorageFactory;
            CompletedRequestHistory = other.CompletedRequestHistory;
            SleepTimeInMilliseconds = other.SleepTimeInMilliseconds;
            TimeoutInMilliseconds = other.TimeoutInMilliseconds;
        }
        #region WebCrawlerSettings Members

        IComparer<Request> _RequestPriorityComparer;
        public IComparer<Request> RequestPriorityComparer {
            get { return _RequestPriorityComparer; }
            set { _RequestPriorityComparer = value; }
        }

        LinkExtractor _LinkExtractor;
        public LinkExtractor LinkExtractor {
            get { return _LinkExtractor; }
            set { _LinkExtractor = value; }
        }

        int _WorkerCount;
        public int WorkerCount {
            get { return _WorkerCount; }
            set { _WorkerCount = value; }
        }

        IEnumerable<string> _StartingUris;
        public IEnumerable<string> StartingUris {
            get { return _StartingUris; }
            set { _StartingUris = value; }
        }

        LinkSelector _Selector;
        public LinkSelector Selector {
            get { return _Selector; }
            set { _Selector = value; }
        }

        TemporaryStorageFactory _StorageFactory;
        public TemporaryStorageFactory StorageFactory {
            get { return _StorageFactory; }
            set { _StorageFactory = value; }
        }

        CompletedRequestHistory _CompletedRequestHistory;
        public CompletedRequestHistory CompletedRequestHistory {
            get { return _CompletedRequestHistory; }
            set { _CompletedRequestHistory = value; }
        }

        int _SleepTimeInMilliseconds;
        public int SleepTimeInMilliseconds {
            get { return _SleepTimeInMilliseconds; }
            set { _SleepTimeInMilliseconds = value; }
        }

        private int _TimeoutInMilliseconds;
        public int TimeoutInMilliseconds {
            get { return _TimeoutInMilliseconds; }
            set { _TimeoutInMilliseconds = value; }
        }

        #endregion

        #region WebCrawlerComponent Members
        public bool InitializeWasCalled = false;
        public void Initialize(WebCrawlerContext context) {
            InitializeWasCalled = true;
        }

        #endregion
    }
}
